<?php
	/*Gérald Plusquellec*/
	class controller_login
	{
		public $controller;
		public $action;
		
		public function __construct()
		{
			$this -> controller = controller :: getInstance();
            $this -> action = $action = getvar('**action**');
            $this -> $action();
            $this -> controller -> html();
		}
		
		public function index()
        {            
            $login = getvarpost('login');
            $mdp = getvarpost('mdp');
            
            if (null !== $login && null !== $mdp)
            {
                $connexion = connexion($login, md5($mdp));
                if (true === $connexion)
                    go(URL_SITE);
                else
                    setvar('__error__', true);
            }
            
            viewRenderer();
        }
	}
?>